package whut.edu.inner;
/*
静态内部类
  前边加个static，Outer.Inner oi = new Outer.Inner()
    静态只能访问静态
 */
public class StaticInner {
    public static void main(String[] args) {
        OuterClass.InnerClass oi = new OuterClass.InnerClass();
        oi.show();
    }
}
class OuterClass{
    int num = 10;
    static int x = 10;
    static class InnerClass{
        public void show(){
            System.out.println("show----");
            System.out.println(x);

            //访问外部类非静态变量，需创建对象
            OuterClass o = new OuterClass();
            System.out.println(o.num);

        }
    }
}
